﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

public class TransparentLabel : Control
{
    public TransparentLabel()
    {
        TabStop = false;
        this.Size = new Size(5, 10);
    }
    protected override CreateParams CreateParams
    {
        get
        {
            CreateParams cp = base.CreateParams;
            cp.ExStyle = cp.ExStyle | 0x20;
            return cp;
        }
    }
    protected override void OnPaintBackground(PaintEventArgs e)
    {
        // do nothing 
    }
    protected override void OnPaint(PaintEventArgs e)
    {
        using (SolidBrush brush = new SolidBrush(ForeColor))
        {
            e.Graphics.DrawString(this.Text, Font, brush, -1, 0);
        }
    }
}